package com.ccrfid.rmc6.entity.business.patrol;

import com.ccrfid.rmc6.appconfig.jackson.CustomDouble4Serialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import javax.persistence.*;

@Entity
@Table(name = "patrol_location_overall")
public class PatrolLocationOverallEntity {
    private Long id;
    private Long scheduleId;
    private Long locationId;
    private String locationName;
    private Integer patrolStatus;   //-0-正常；1-异常;2-无人巡控；
    @JsonSerialize(using = CustomDouble4Serialize.class)
    private Double completionRate;

    public PatrolLocationOverallEntity() {
    }

    public PatrolLocationOverallEntity(Long scheduleId, Long locationId, String locationName) {
        this.scheduleId = scheduleId;
        this.locationId = locationId;
        this.locationName = locationName;
    }

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "schedule_id", nullable = false)
    public Long getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(Long scheduleId) {
        this.scheduleId = scheduleId;
    }

    @Basic
    @Column(name = "location_id", nullable = false)
    public Long getLocationId() {
        return locationId;
    }

    public void setLocationId(Long locationId) {
        this.locationId = locationId;
    }

    @Basic
    @Column(name = "location_name", length = 64)
    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    @Basic
    @Column(name = "patrol_status", nullable = false)
    public Integer getPatrolStatus() {
        return patrolStatus;
    }

    public void setPatrolStatus(Integer patrolStatus) {
        this.patrolStatus = patrolStatus;
    }

    @Basic
    @Column(name = "completion_rate", nullable = false)
    public Double getCompletionRate() {
        return completionRate;
    }

    public void setCompletionRate(Double completionRate) {
        this.completionRate = completionRate;
    }
}
